package com.Jshop.search.pojo;

import com.Jshop.common.pojo.PageResult;
import com.leyou.item.pojo.Brand;

import java.util.List;
import java.util.Map;

/**
 * 扩展前端需要的PageResult对象
 * 主要扩展了分类集合还有品牌集合
 * */
public class SearchResult extends PageResult<Goods> {

    //返回给前台做展示与二次搜搜筛选的 产出相关分类
    private List<Map<String, Object>> categories;
    //返回给前台做展示与二次搜搜筛选的 产出相关品牌
    private List<Brand> brands;
    //返回给前台做展示与二次搜搜筛选的 产出相关规格餐宿
    private List<Map<String, Object>> specs;
    public SearchResult() {
    }

    public SearchResult(List<Map<String, Object>> categories, List<Brand> brands) {
        this.categories = categories;
        this.brands = brands;
    }

    /**
     * PageResult<Goods>是自定义的分页结果集对象
     * 该类继承之并扩展了相关属性
     * */
    public SearchResult(List<Goods> content, long totalElements, int totalPages, List<Map<String, Object>> categoryAggResult, List<Brand> brandAggResult,List<Map<String, Object>> specs) {
        super(totalElements,totalPages,content);
        this.brands = brandAggResult;
        this.categories = categoryAggResult;
        this.specs = specs;
    }

    public List<Map<String, Object>> getSpecs() {
        return specs;
    }

    public void setSpecs(List<Map<String, Object>> specs) {
        this.specs = specs;
    }

    public List<Map<String, Object>> getCategories() {
        return categories;
    }

    public void setCategories(List<Map<String, Object>> categories) {
        this.categories = categories;
    }

    public List<Brand> getBrands() {
        return brands;
    }

    public void setBrands(List<Brand> brands) {
        this.brands = brands;
    }


}
